#include <stdio.h>

int reverseInt(int x)
{
	int b=0;
	for(;x;)
	{
		b=b*10+x%10;
		x/=10;
	}
	return b;
}

int main(int argc, char const *argv[])
{
	int a,b;
	int palindrome;
	int max=0;
	for(a=100;a<=999;a++)
	{
		for(b=100;b<=999;b++)
		{
			palindrome=a*b;
			if(palindrome == reverseInt(palindrome) && palindrome>max)
				max = palindrome;
		}
	}
	printf("%d\n", max);
	return 0;
}